import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AgentSdIncomeVO, AgentSdIncomeForm, AgentSdIncomeQuery } from '@/api/business/agentSdIncome/types';

/**
 * 查询省代收入记录列表
 * @param query
 * @returns {*}
 */

export const listAgentSdIncome = (query?: AgentSdIncomeQuery): AxiosPromise<AgentSdIncomeVO[]> => {
  return request({
    url: '/business/agentSdIncome/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询省代收入记录详细
 * @param id
 */
export const getAgentSdIncome = (id: string | number): AxiosPromise<AgentSdIncomeVO> => {
  return request({
    url: '/business/agentSdIncome/' + id,
    method: 'get'
  });
};

/**
 * 新增省代收入记录
 * @param data
 */
export const addAgentSdIncome = (data: AgentSdIncomeForm) => {
  return request({
    url: '/business/agentSdIncome',
    method: 'post',
    data: data
  });
};

/**
 * 修改省代收入记录
 * @param data
 */
export const updateAgentSdIncome = (data: AgentSdIncomeForm) => {
  return request({
    url: '/business/agentSdIncome',
    method: 'put',
    data: data
  });
};

/**
 * 删除省代收入记录
 * @param id
 */
export const delAgentSdIncome = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/agentSdIncome/' + id,
    method: 'delete'
  });
};
